home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 4779 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  2.5 KB

  1. Path: interramp.com!usenet
  2. From: Barnett@interramp.com (Barnett E. Kurtz)
  3. Newsgroups: comp.lang.c,comp.lang.c++,comp.os.msdos.programmer
  4. Subject: Re: Device Drivers
  5. Date: Thu, 01 Feb 1996 01:49:51 GMT
  6. Organization: EntroData, Inc.
  7. Message-ID: <4ep6ae$2o6@usenet7.interramp.com>
  8. References: <4em26p$el1@canopus.cc.umanitoba.ca>
  9. Reply-To: Barnett@interramp.com
  10. NNTP-Posting-Host: ip149.philadelphia.pa.interramp.com
  11. X-Newsreader: Forte Free Agent 1.0.82
  12.  
  13. Nathan,
  14.  
  15. This is probably not the best place to ask this type of question.
  16. comp.os.ms-dos.programmer would be better. It is very OS dependent. 
  17.  
  18. However, you might try using the dynamic overlay loading feature of
  19. BCC. Place your asm code in separate modules. TASM  will compile them
  20. when you do your build. Reference them from main and let main() do the
  21. driving, i.e. BCC will link your ASM, etc and build the overlays for
  22. you. As a byproduct the mini-drivers will now demand load from disk or
  23. expanded memory (if available) as needed. Also, consider doing your C
  24. code and build without the need for the C runtime. It has been a few
  25. years, but as I recall it is pretty large. If you are already doing
  26. most of the work in ASM it should not be to difficult to do.
  27. -
  28. Good Luck!
  29. barnett@interramp.com
  30. _
  31. natewild@mbnet.mb.ca (Nathan T. Wild) wrote:
  32.  
  33. >I would like to be able to make device drivers in C. I writing an
  34. >application which uses loadable modules for some of it's functions.  
  35. >Currently these functions are written in Assembly language.  The
  36. >assembled executable code is stripped of it's EXE header and the
  37. >contents is written directly to memory...  Then a function pointer is
  38. >set to point to this code.
  39. >This works...  But how can I go about generating these executable
  40. >"driver" files in C, rather than assembly language?  In order to link my
  41. >C code, I need a main()?
  42. >Can this be done?  Can somebody explain how to do it?
  43. >I actually want a C++ class to load these modules in from it's
  44. >constructor, but I am currently stuck writing everything in assembly
  45. >language? 
  46. >Does anyone know how to translate the object-code generated by the C
  47. >compiler into raw executable code for loading as a device driver in this
  48. >manner?
  49. >I am using DOS and Borland C++, but that shouldn't really matter...
  50. >Please respond via email, as I do not have live access to this group.
  51. >If I get a collection of good responses, I will post a follow-up to
  52. >comp.os.msdos.programmer, comp.lang.c and comp.lang.c++
  53.  
  54. -
  55. barnett@interramp.com
  56. -
  57.  
  58.